Skip to content

ctb: Move threshold check from LivenessModule constructor#10516

Merged
maurelian merged 4 commits intodevelopfrom
maur/threshold-check
May 14, 2024
Merged

ctb: Move threshold check from LivenessModule constructor#10516
maurelian merged 4 commits intodevelopfrom
maur/threshold-check

Conversation

@maurelian
Copy link
Contributor

@maurelian maurelian commented May 13, 2024

ctb: Move threshold check from LivenessModule constructor

Performs the check in the deployment scripts instead.

Copy link
Contributor Author

maurelian commented May 13, 2024

@maurelian maurelian changed the title ctb: Update snapshots and semver-lock ctb: Move threshold check from LivenessModule constructor May 13, 2024
@maurelian maurelian marked this pull request as ready for review May 13, 2024 16:09
@maurelian maurelian requested a review from a team as a code owner May 13, 2024 16:09
@maurelian maurelian requested review from clabby and removed request for a team May 13, 2024 16:09
@maurelian maurelian force-pushed the maur/threshold-check branch from 0bd93a7 to 421e479 Compare May 13, 2024 16:48
Base automatically changed from maur/safe-version-downgrade to develop May 13, 2024 17:11
@maurelian maurelian force-pushed the maur/threshold-check branch from 421e479 to 6e21846 Compare May 13, 2024 20:22
@coderabbitai
Copy link
Contributor

coderabbitai bot commented May 13, 2024

Walkthrough

Walkthrough

The changes involve restructuring the deployment and enabling process of the Liveness Module in the DeployOwnership contract. The threshold validation logic in the LivenessModule contract has been simplified by removing a specific check. Tests have been enhanced with new assertions and variables to ensure correct threshold settings. Additionally, the SafeTestTools contract now includes new utility functions and parameters to facilitate easier setup and testing of Safe instances.

Changes

Files Change Summary
.../scripts/DeployOwnership.s.sol Restructured logic for deploying and enabling the Liveness Module using _callViaSafe.
.../src/Safe/LivenessModule.sol Removed the threshold validation check based on the number of owners.
.../test/Safe/DeployOwnership.t.sol Added new assertion to verify the threshold on the safe matches the Liveness Module's required threshold.
.../test/Safe/LivenessGuard.t.sol Introduced threshold and ownerCount variables, modified setUp function, and adjusted signers array elements assignment.
.../test/Safe/LivenessModule.t.sol Removed the test_constructor_wrongThreshold_reverts function.
.../test/safe-tools/SafeTestTools.sol Added saltNonce initialization, modified _setupSafe function, added overloaded _setupSafe functions, and introduced getSafe functions to retrieve Safe instances.

Recent Review Details

Configuration used: .coderabbit.yml
Review profile: CHILL

Commits Files that changed from the base of the PR and between 437d924 and 7248b95.
Files ignored due to path filters (1)
  • packages/contracts-bedrock/semver-lock.json is excluded by !**/*.json
Files selected for processing (5)
  • packages/contracts-bedrock/scripts/DeployOwnership.s.sol (2 hunks)
  • packages/contracts-bedrock/src/Safe/LivenessModule.sol (1 hunks)
  • packages/contracts-bedrock/test/Safe/DeployOwnership.t.sol (1 hunks)
  • packages/contracts-bedrock/test/Safe/LivenessGuard.t.sol (2 hunks)
  • packages/contracts-bedrock/test/Safe/LivenessModule.t.sol (1 hunks)
Files skipped from review as they are similar to previous changes (5)
  • packages/contracts-bedrock/scripts/DeployOwnership.s.sol
  • packages/contracts-bedrock/src/Safe/LivenessModule.sol
  • packages/contracts-bedrock/test/Safe/DeployOwnership.t.sol
  • packages/contracts-bedrock/test/Safe/LivenessGuard.t.sol
  • packages/contracts-bedrock/test/Safe/LivenessModule.t.sol

Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media?

Share
Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>.
    • Generate unit testing code for this file.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai generate unit testing code for this file.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai generate interesting stats about this repository and render them as a table.
    • @coderabbitai show all the console.log statements in this repository.
    • @coderabbitai read src/utils.ts and generate unit testing code.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (invoked as PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger a review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai help to get help.

Additionally, you can add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.

CodeRabbit Configration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

@maurelian maurelian force-pushed the maur/threshold-check branch 3 times, most recently from 87f042f to 437d924 Compare May 14, 2024 16:43
@maurelian maurelian changed the base branch from develop to maur/safe-test-imp May 14, 2024 16:44
@maurelian maurelian requested a review from mds1 May 14, 2024 16:49
@maurelian maurelian force-pushed the maur/safe-test-imp branch from 39b3aad to 93d1655 Compare May 14, 2024 17:27
@maurelian maurelian force-pushed the maur/threshold-check branch from 32ccd7f to f5cbadd Compare May 14, 2024 17:27
@maurelian maurelian force-pushed the maur/threshold-check branch from f5cbadd to cae0cd8 Compare May 14, 2024 19:30
@maurelian maurelian force-pushed the maur/safe-test-imp branch from 070c141 to 93d1655 Compare May 14, 2024 21:07
Base automatically changed from maur/safe-test-imp to develop May 14, 2024 21:34
@maurelian maurelian force-pushed the maur/threshold-check branch from cae0cd8 to 7248b95 Compare May 14, 2024 21:34
Copy link
Contributor Author

maurelian commented May 14, 2024

Merge activity

  • May 14, 5:35 PM EDT: Graphite rebased this pull request as part of a merge.
  • May 14, 5:58 PM EDT: Graphite failed to merge this pull request due to This repository has GitHub's merge queue enabled, which is currently incompatible with Graphite. Try your merge again, or report a bug if you see this consistently.

@codecov
Copy link

codecov bot commented May 14, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 29.22%. Comparing base (db3871d) to head (7248b95).

Additional details and impacted files
@@             Coverage Diff             @@
##           develop   #10516      +/-   ##
===========================================
- Coverage    31.00%   29.22%   -1.79%     
===========================================
  Files           63       31      -32     
  Lines         3757     2898     -859     
  Branches       766      614     -152     
===========================================
- Hits          1165      847     -318     
+ Misses        2517     1976     -541     
  Partials        75       75              
Flag Coverage Δ
chain-mon-tests 27.14% <ø> (ø)
common-ts-tests ?
contracts-ts-tests 12.25% <ø> (ø)
core-utils-tests ?
sdk-tests 40.27% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

see 32 files with indirect coverage changes

@maurelian maurelian added this pull request to the merge queue May 14, 2024
Merged via the queue into develop with commit 53c00e9 May 14, 2024
@maurelian maurelian deleted the maur/threshold-check branch May 14, 2024 22:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants